import '../../model/consult.dart';

/// @Author lixiaobin
/// @Date 2024/2/22
/// @Description
class ConsultationUtils {
  /// 咨询类型
  static String getType(String? type) {
    String typeStr = '';
    switch (type ?? '') {
      case 'imageTextConsult':
        typeStr = '图文咨询';
        break;
      case 'phoneConsult':
        typeStr = '电话咨询';
        break;
      case 'videoConsult':
        typeStr = '视频咨询';
        break;
      default:
        break;
    }
    return typeStr;
  }

  /// 图文咨询
  static bool isImageTextConsult(String? type) {
    return type == 'imageTextConsult';
  }

  /// 电话咨询
  static bool isPhoneConsult(String? type) {
    return type == 'phoneConsult';
  }

  /// 视频咨询
  static bool isVideoConsult(String? type) {
    return type == 'videoConsult';
  }

  /// 状态
  static String getStatus(ConsultModel item) {
    var statusText = '';
    switch (item.status ?? '') {
      case '0':
        statusText = '待支付';
        break;
      case '1':
        statusText = '待接诊';
        break;
      case '2':
        statusText = '已结束';
        break;
      case '3':
        statusText = '会话中';
        break;
      case '5':
        statusText = '取消预约订单';
        break;
      case '4':
      case '6':
        statusText = '未接诊';
        break;
      default:
        break;
    }
    return statusText;
  }
}
